package com.magic.smartcity.view.adapters;

import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.navigation.Navigation;

import com.magic.smartcity.R;

/**
 * @description:
 * @create: Create by Magic on 2022/2/2.
 */
public class HomeHotAdapter extends BaseAdapter {
    private static final String TAG = HomeHotAdapter.class.getSimpleName();

    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_hot_topic, parent, false);
        View card = view.findViewById(R.id.click_on);
        card.setOnClickListener(v -> Navigation.findNavController(v).navigate(R.id.action_nav_home_to_homeHotTopicFragment));
        ImageView image = view.findViewById(R.id.hot_image);
        TextView title = view.findViewById(R.id.hot_title);
        return view;
    }
}
